﻿''' <summary>
''' Prepend this attribute to property declarations correspondings to a field of datarow.
''' If the declared property corresponds to a key field of a datarow, set isKey = "True"
''' 
''' This custom attribute added to a declared class property will be extracted and processed
''' by the DataRowMappedPropertiesHandler object to automatic property-to-db-fields operations
''' such as refresh property values from datarow or insert/update/delete datarow using property values.
''' </summary>
''' <remarks></remarks>
<AttributeUsage(AttributeTargets.Property)>
Public Class DbFieldNameAttribute
    Inherits Attribute

    Property IsKey As Boolean = False
    Property Name As String

    Public Sub New(fieldName As String)
        Me.Name = fieldName
    End Sub

    Public Sub New(fieldName As String, isKey As Boolean)
        Me.Name = fieldName
        Me.IsKey = isKey
    End Sub
End Class

